subroutine init_profile_map(lunit)
  use param,only:max_diss
  use param,only:max_rctn
  use profile_map_param,only:profile_map_diff
  use profile_map_param,only:profile_map_diss
  use profile_map_param,only:profile_map_rctn
  use profile_map_param,only:profile_map_extn
  use profile_map_param,only:profile_map_sink
  use profile_map_param,only:profile_map_srce
  use label_data_param,only:n_obj_type
  use react_data_param,only:n_react_type
  use global_param,only:n_ext
  use sink_data_param,only:n_sink_type
  use geom_data_param,only:n_geom_obj
  implicit none

  integer,intent(in) :: lunit

  integer :: i,j

  ! Save the index of the profile table
  nullify(profile_map_diff)
  nullify(profile_map_diss)
  nullify(profile_map_rctn)
  nullify(profile_map_extn)
  nullify(profile_map_sink)
  nullify(profile_map_srce)

  if (n_obj_type.eq.0) call abnormal_stop("init_profile_map",&
       "n_obj_type is zero.")

  ! diffusion of the object
  allocate(profile_map_diff(n_obj_type))
  do i=1,n_obj_type
     profile_map_diff(i)=0
  end do

  ! dissociation of the object
  allocate(profile_map_diss(n_obj_type,max_diss))
  do i=1,n_obj_type
     do j=1,max_diss
        profile_map_diss(i,j)=0
     end do
  end do

  ! reaction between objects
  if (n_react_type.gt.0) &
       allocate(profile_map_rctn(n_react_type,max_rctn))
  do i=1,n_react_type
     do j=1,max_rctn
        profile_map_rctn(i,j)=0
     end do
  end do

  ! external events
  if (n_ext.gt.0) &
       allocate(profile_map_extn(n_ext))
  do i=1,n_ext
     profile_map_extn(i)=0
  end do

  ! reaction between geom_obj and object
  if (n_sink_type.gt.0) &
       allocate(profile_map_sink(n_sink_type,max_rctn))
  do i=1,n_sink_type
     do j=1,max_rctn
        profile_map_sink(i,j)=0
     end do
  end do

  ! source by geom_obj
  if (n_geom_obj.gt.0) &
       allocate(profile_map_srce(n_geom_obj,max_diss))
  do i=1,n_geom_obj
     do j=1,max_diss
        profile_map_srce(i,j)=0
     end do
  end do

  return

end subroutine init_profile_map
